x11/dnd: Ignore grab broken events from other devices than our DnD device.
authorCarlos Garnacho <carlosg@gnome.org>
Tue, 17 May 2016 17:27:00 +0000 (19:27 +0200)
committerCarlos Garnacho <carlosg@gnome.org>
Wed, 18 May 2016 10:54:40 +0000 (12:54 +0200)
The GdkDragContext should only listen to GDK_GRAB_BROKEN events sent to
its own pointer device. It turns out that the passive key grabs mistake
GDK into sending a GdkEventGrabBroken on the master keyboard, which the
DnD machinery mistakes as a signal to cancel the operation.

https://bugzilla.gnome.org/show_bug.cgi?id=766442

gdk/x11/gdkdnd-x11.c

index c433b173abfe7f797603d738fde4e6c058515822..439981853c7835aba6bc486372f4d709b68f949f 100644 (file)
@@ -3042,6 +3042,10 @@ gdk_dnd_handle_grab_broken_event (GdkDragContext           *context,
       event->grab_window == x11_context->ipc_window)
     return FALSE;
 
+  if (gdk_event_get_device ((GdkEvent *) event) !=
+      gdk_drag_context_get_device (context))
+    return FALSE;
+
   gdk_drag_context_cancel (context, GDK_DRAG_CANCEL_ERROR);
   return TRUE;
 }